package protocol

import "JoRedis/constant"

type StandardErrReply struct {
	ErrMsg string
}

func MakeErrReply(errMsg string) *StandardErrReply {
	return &StandardErrReply{ErrMsg: errMsg}
}

func (this *StandardErrReply) ToBytes() []byte {
	return []byte("-" + this.ErrMsg + constant.CRLF)
}

// GetErrMsg 获取协议的异常信息
func (this *StandardErrReply) GetErrMsg() string {
	return this.ErrMsg
}
